home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / UTILITY1 / FDUMP102.ZIP / FILEDUMP.FRM < prev    next >
Text File  |  1993-10-12  |  36KB  |  1,072 lines

  1. VERSION 2.00
  2. Begin Form Form_Main 
  3.    ClientHeight    =   4860
  4.    ClientLeft      =   1140
  5.    ClientTop       =   1680
  6.    ClientWidth     =   8070
  7.    Height          =   5550
  8.    Icon            =   FILEDUMP.FRX:0000
  9.    Left            =   1080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4860
  12.    ScaleWidth      =   8070
  13.    Top             =   1050
  14.    Width           =   8190
  15.    Begin CommandButton cbNext 
  16.       Caption         =   "Next"
  17.       Height          =   212
  18.       Left            =   6840
  19.       TabIndex        =   2
  20.       Top             =   4560
  21.       Visible         =   0   'False
  22.       Width           =   615
  23.    End
  24.    Begin CommandButton cbPrev 
  25.       Caption         =   "Prev"
  26.       Height          =   212
  27.       Left            =   600
  28.       TabIndex        =   1
  29.       Top             =   4560
  30.       Visible         =   0   'False
  31.       Width           =   615
  32.    End
  33.    Begin CommonDialog CMDialog1 
  34.       FontName        =   "Courier New"
  35.       FontSize        =   10
  36.       InitDir         =   "C:\"
  37.       Left            =   0
  38.       Top             =   4320
  39.    End
  40.    Begin ListBox GrpDetail 
  41.       FontBold        =   -1  'True
  42.       FontItalic      =   0   'False
  43.       FontName        =   "Courier New"
  44.       FontSize        =   8.25
  45.       FontStrikethru  =   0   'False
  46.       FontUnderline   =   0   'False
  47.       Height          =   3600
  48.       Left            =   0
  49.       TabIndex        =   0
  50.       TabStop         =   0   'False
  51.       Top             =   0
  52.       Width           =   8055
  53.    End
  54.    Begin Label lblFileSize 
  55.       Alignment       =   2  'Center
  56.       Height          =   210
  57.       Left            =   1440
  58.       TabIndex        =   3
  59.       Top             =   4560
  60.       Width           =   5175
  61.    End
  62.    Begin Menu M_File 
  63.       Caption         =   "&File"
  64.       Begin Menu M_FileOpen 
  65.          Caption         =   "&Open"
  66.       End
  67.       Begin Menu M_FilePrint 
  68.          Caption         =   "&Print"
  69.       End
  70.       Begin Menu M_FileBar1 
  71.          Caption         =   "-"
  72.       End
  73.       Begin Menu M_FileExit 
  74.          Caption         =   "E&xit"
  75.       End
  76.    End
  77.    Begin Menu M_Help 
  78.       Caption         =   "&Help"
  79.       Begin Menu M_HelpAbout 
  80.          Caption         =   "&About"
  81.       End
  82.    End
  83. End
  84. Option Explicit
  85. '
  86. '--------------------------------------------------------
  87. ' Module Level Globals
  88. '--------------------------------------------------------
  89. Dim imPixelsPerChar As Integer
  90. Dim fmForm_MainTopDefault As Single
  91. Dim smSourceFileName As String
  92. Dim imMaxRecord As Integer
  93. Dim imPriorShow As Integer
  94. '
  95. Dim imBlockStarts(50) As Integer
  96. Dim imBlockNumber As Integer
  97. '
  98. Const ICON_TWIPS = 540
  99. Const MIN_WIDTH = 8070
  100. Const MIN_HEIGHT = 4650
  101. Const BLOCK_SIZE = 4096
  102. '
  103.  
  104. '--------------------------------------------------------
  105. '--------------------------------------------------------
  106. Sub cbNext_Click ()
  107.   '
  108.   Dim sBuffer As String
  109.   Dim iEndOfFileFlag As Integer
  110.   '
  111.   ' Update BlockStarts Vector Pointer
  112.   If imBlockStarts(imBlockNumber + 1) > imBlockStarts(imBlockNumber) Then
  113.     imBlockNumber = imBlockNumber + 1
  114.   End If
  115.   '
  116.   cbNext.Visible = False
  117.   cbPrev.Visible = False
  118.   '
  119.   iEndOfFileFlag = False
  120.   GrpDetail.Clear
  121.   Form_Main.MousePointer = HOURGLASS
  122.   Call ReadBack(sgWorkFileName, imBlockStarts(imBlockNumber), imMaxRecord, iEndOfFileFlag, sBuffer)
  123.   Form_Main.MousePointer = DEFAULT
  124.     Debug.Print "cbNext_Click: ";
  125.     Debug.Print "imBlockStarts("; imBlockNumber; ")=";
  126.     Debug.Print imBlockStarts(imBlockNumber)
  127.   '
  128.   ' Update BlockStarts Vector
  129.   If imBlockStarts(imBlockNumber + 1) <= imBlockStarts(imBlockNumber) Then
  130.     imBlockStarts(imBlockNumber + 1) = imBlockStarts(imBlockNumber) + GrpDetail.ListCount
  131.       Debug.Print "cbNext_Click: GrpDetail.ListCount=";
  132.       Debug.Print GrpDetail.ListCount;
  133.       Debug.Print " imMaxRecord="; imMaxRecord;
  134.       Debug.Print "  imBlockStarts("; imBlockNumber + 1; ")=";
  135.       Debug.Print imBlockStarts(imBlockNumber + 1)
  136.   End If
  137.   '
  138.   '
  139.   If imBlockNumber > 1 Then
  140.     cbPrev.Visible = True
  141.   End If
  142.   '
  143.   If imBlockStarts(imBlockNumber + 1) < imMaxRecord Then
  144.     cbNext.Visible = True
  145.   End If
  146.  
  147. End Sub
  148.  
  149. '--------------------------------------------------------
  150. '--------------------------------------------------------
  151. Sub cbPrev_Click ()
  152.   '
  153.   Dim sBuffer As String
  154.   Dim iEndOfFileFlag As Integer
  155.   '
  156.   ' Update BlockStarts Vector Pointer
  157.   imBlockNumber = imBlockNumber - 1
  158.   '
  159.   cbNext.Visible = False
  160.   cbPrev.Visible = False
  161.   '
  162.   iEndOfFileFlag = False
  163.   GrpDetail.Clear
  164.   Form_Main.MousePointer = HOURGLASS
  165.   Call ReadBack(sgWorkFileName, imBlockStarts(imBlockNumber), imMaxRecord, iEndOfFileFlag, sBuffer)
  166.   Form_Main.MousePointer = DEFAULT
  167.     Debug.Print "cbPrev_Click: ";
  168.     Debug.Print "imBlockStarts("; imBlockNumber; ")=";
  169.     Debug.Print imBlockStarts(imBlockNumber)
  170.   '
  171.     Debug.Print "cbPrev_Click: GrpDetail.ListCount=";
  172.     Debug.Print GrpDetail.ListCount;
  173.     Debug.Print " imMaxRecord="; imMaxRecord;
  174.     Debug.Print "  imBlockStarts("; imBlockNumber + 1; ")=";
  175.     Debug.Print imBlockStarts(imBlockNumber + 1)
  176.   '
  177.   '
  178.   If imBlockNumber > 1 Then
  179.     cbPrev.Visible = True
  180.   End If
  181.   '
  182.   If imBlockStarts(imBlockNumber) < imMaxRecord Then
  183.     cbNext.Visible = True
  184.   End If
  185.  
  186. End Sub
  187.  
  188. '---------------------------------------------------------
  189. ' Process Form_Load Event
  190. '---------------------------------------------------------
  191. Sub Form_Load ()
  192.   '
  193.   '' Set Global Program ID Values
  194.   sgProgramName = App.EXEName               'Set Program Name
  195.   sgRegistrationStatus = "Un-Registered Shareware"
  196.   sgProgramVersion = "1.02"
  197.   sgCompuserveID = "71055,1043"
  198.   '
  199. '  Debug.Print "CurDir$="; CurDir$
  200. '  Debug.Print "App.Path="; App.Path
  201.   If Right(App.Path, 1) <> "\" Then
  202.     sgWorkFileName = App.Path & "\FILEDUMP.TMP"
  203.   Else
  204.     sgWorkFileName = App.Path & "FILEDUMP.TMP"
  205.   End If
  206. '  Debug.Print "sgWorkFileName="; sgWorkFileName
  207.   '
  208. '  fmForm_MainTopDefault = 10               'Set Production Top
  209.   fmForm_MainTopDefault = 1065              'Set Debugging Top
  210.   imPixelsPerChar = 8
  211.   '
  212.   GrpDetail.Height = 4230                   'Force Height
  213.   '
  214.   Form_Main.Caption = sgProgramName & " " & sgProgramVersion
  215.   '
  216.   '' Insure only one instance is running
  217.   If App.PrevInstance Then
  218.     MsgBox App.EXEName & " is already running!" & Chr$(10) & "  Second instance has been cancelled.", MB_ICONEXCLAMATION
  219.     End
  220.   End If
  221.   '
  222.   '' Set Default Screen Sizing Values
  223.   Form_Main.ScaleMode = TWIPS
  224.   '
  225.   fgCurrentHeightFactor = 1
  226.   fgCurrentWidthFactor = 1
  227.   '
  228.   fgBaseFormLeft = Form_Main.Left
  229.   fgBaseFormTop = Form_Main.Top
  230.   fgBaseFormWidth = Form_Main.Width
  231.   fgBaseFormHeight = Form_Main.Height
  232. '    Debug.Print "Form_Load Base: "; fgBaseFormLeft; fgBaseFormTop; fgBaseFormWidth; fgBaseFormHeight
  233. '    Printer.Print Tab(25); " Left"; Tab(33); "Top"; Tab(40); "Width"; Tab(47); "Height"
  234. '    Printer.Print "Form_Load Base: "; Tab(25); fgBaseFormLeft; Tab(33); fgBaseFormTop; Tab(40); fgBaseFormWidth; Tab(47); fgBaseFormHeight
  235. '    Printer.Print "          GrpDetail: "; Tab(25); GrpDetail.Left; Tab(33); GrpDetail.Top; Tab(40); GrpDetail.Width; Tab(47); GrpDetail.Height
  236. '    Printer.Print "          cbPrev:"; Tab(25); cbPrev.Left; Tab(33); cbPrev.Top; Tab(40); cbPrev.Width; Tab(47); cbPrev.Height
  237. '    Printer.Print "          cbNext:"; Tab(25); cbNext.Left; Tab(33); cbNext.Top; Tab(40); cbNext.Width; Tab(47); cbNext.Height
  238. '    Printer.Print "          lblFileSize:"; Tab(25); lblFileSize.Left; Tab(33); lblFileSize.Top; Tab(40); lblFileSize.Width; Tab(47); lblFileSize.Height
  239.   '
  240.   '' Make sure Form will fit the Screen Size
  241.   If fgBaseFormLeft + fgBaseFormWidth > Screen.Width Then
  242.     MsgBox "The program calls for Higher Horizontal Resolution." & Chr$(10) & " -- The Default Maximum will be used.", MB_ICONEXCLAMATION
  243.     fgBaseFormLeft = 10
  244.     fgBaseFormWidth = Screen.Width - fgBaseFormLeft
  245.   End If
  246.   '
  247.   If fgBaseFormTop + fgBaseFormHeight > Screen.Height Then